import { ccenum } from "cc"

export namespace collisionTag {
    export enum Define {
        Scene = 0,
        Player = 101,
        Enemy = 102,
        PlayerProjectile = 104,
        EnemyProjectile = 105,
    }
    ccenum(Define) // 可可让编辑器上显示不为数字
    export function isProjectileHitable(projectileTag: number, otherTag: number): boolean {

        if (projectileTag === Define.PlayerProjectile) {

            let r = otherTag === Define.Scene || otherTag === Define.Enemy
            // console.log('玩家子弹 ---打中 ' + otherTag, r)
            return r
        }
        if (projectileTag === Define.EnemyProjectile) {
            let r = otherTag === Define.Scene || otherTag === Define.Player
            // console.log('怪物子弹 ---打中 ' + otherTag, r)
            return r
        }
        return false
    }
}
